package com.aigc.txt2img.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

public class TimeUtil {

    public static String generateGmtDate() {
        SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH);  // Locale.ENGLISH
        dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
        return dateFormat.format(new Date());
    }

    public static int getCurTimestamp() {
        return (int)(System.currentTimeMillis()/1000);
    }

    public static void main(String[] args) {
        System.out.println(getCurTimestamp());
    }
}
